package com.ac;

import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.Reader;
import java.util.Properties;
/**
 * 
 * @author Administrator
 *	权限控制实现
 */
public class ACDemo {
		
//	查询数据库（用properties文件模仿数据库查询）,查询用户的菜单，即可执行操作
	public String[] getMenu(String name) {
		Properties properties=new Properties();
		InputStream inputStream=ACDemo.class.getClassLoader().getResourceAsStream("acall.properties");
		try {
			properties.load(inputStream);
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return properties.getProperty(name).split(",");
	}
		public static void main(String[] args) throws IOException {
			//根据用户查询数据库，取得此用户的菜单数组
			//	用户名:user1,user2,user3	
			String[] menu = new ACDemo().getMenu("user1");
			for (String string : menu) {
				System.out.print(string+"\t");
			}
			
		}
}
